/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.ventas.beans;


import cl.ventas.modelo.Ventas;
import cl.ventas.modelo.dao.VentasDao;
import java.util.List;

/**
 *
 * @author RITTER
 */
public class VentasBean extends Ventas{
    private VentasDao ventasDao = new VentasDao();

    public List<Ventas> findAll() {
        return ventasDao.findAll();
    }

   public Ventas findById() {
        Ventas ventas = null;
        if (Codigo > 0) {
            ventas = ventasDao.findById(Codigo);
        } else {
            ventas= new Ventas();
        }
        return ventas;
    }
     public void save() {
        ventasDao.save(this);
    }
     public void delete() {
        ventasDao.delete(this);
    }
     
}
